package com.handpay.nocardpay.baselibrary.main.widget;

import android.content.Context;
import android.view.View;
import android.widget.AdapterView;

import com.handpay.nocardpay.baselibrary.logutils.HPLog;

import java.util.HashMap;

/**
 * Created by lyang on 2017/8/11.
 */

public class IconBaseOnItemClickListener implements AdapterView.OnItemClickListener {
    private Context mContext;

    public IconBaseOnItemClickListener(Context context) {
        mContext = context;
    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        String tag = ((IconBaseAdapter) parent.getAdapter()).getData().get(position);
        HPLog.i(HPLog.YL_TAG, "onItemClick:" + tag);
        gridViewItemOnclick(tag);
    }

    public void gridViewItemOnclick(String tag) {
        HashMap<String, PayChannelInfo> maps = PayChannelInfo.getPayChannelInfos();
        PayChannelInfo info = maps.get(tag);
        HPLog.i(HPLog.YL_TAG, "gridViewItemOnclick:" + info.toString());
    }
}